Securing Docker
Follow these guidelines to secure the Docker container during the product deployment.
- Update the Host and Docker
- Do not Expose the Docker Daemon Socket
- Running Docker Container as a Non Root User
- Limit Capabilities
- Add "–no-new-privileges" flag
- Disable Inter-Container Communication (--icc=false)
- Use Linux Security Module (seccomp, AppArmor, or SELinux)
- Limit Resources (memory, CPU, file descriptors, processes, restarts)
- Set Filesystem and Volumes to Read-only
- Use Static Analysis Tools
- Set the Logging Level to at least INFO
- Lint the Dockerfile at Build Time
- Docker Security Operations- Docker Swarm Configuration
- Run the Docker Daemon as a Non-root User (Rootless mode)